#
# This file is a part of the open-eBackup project.
# This Source Code Form is subject to the terms of the Mozilla Public License, v. 2.0.
# If a copy of the MPL was not distributed with this file, You can obtain one at
# http://mozilla.org/MPL/2.0/.
#
# Copyright (c) [2024] Huawei Technologies Co.,Ltd.
#
# THIS SOFTWARE IS PROVIDED ON AN "AS IS" BASIS, WITHOUT WARRANTIES OF ANY KIND,
# EITHER EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO NON-INFRINGEMENT,
# MERCHANTABILITY OR FIT FOR A PARTICULAR PURPOSE.
#

from typing import Dict, List
from pydantic import BaseModel, Field


class LogBackupParam(BaseModel):
    user_name: str = Field(description="用户")
    db_name: str = Field(description="数据库名称")
    log_chain: str = Field(None, description="日志链")
    cache_path: str = Field(None, description="缓存路径")
    cur_node_ptn_nums: List = Field(None, description="当前节点分片数量")
    is_catalog_node: bool = Field(False, description="是否编目节点")
    since_timestamp: str = Field(None, description="时间戳")
    deploy_type: str = Field(None, description="部署类型")


class CopyReportParam(BaseModel):
    bak_time: str = Field(description="备份时间")
    cache_path: str = Field(description="缓存路径")
    backup_type: int = Field(description="备份类型")
    user_name: str = Field(description="用户")
    pre_copy_end_timestamp: str = Field(None, description="前一个副本备份结束时间")
    copy_log_ext_info: Dict = Field(None, description="副本扩展信息")


class LogBackResult(BaseModel):
    bak_time: str = Field(description='备份时间')
    pre_copy_end_timestamp: str = Field(description='前一个副本备份结束时间')
    copy_log_ext_info: Dict = Field(description='副本扩展信息')
    backup_path: str = Field(description='副本路径')
